Page Comparison - ReSharper for Data Access (v.6 vs v.7)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Redirect
locationhttp://www.jetbrains.com/resharperplatform/help?Keyword=ReSharper_for_data_access

Regardless of which database and driver/ORM you use, the tasks for setting up data access in you application are very similar. From the creation of your entities, to the setting up of your repository, ReSharper is there to help you get the job done better and faster.

...

And if you pick all the properties and press Finish, your class will acquire the following generated constructor:

Code Block

public Person(string name, int age)
{
  Name = name;
  Age = age;
}

...

One last example (there are many more options available) is the automatic creation of a ToString() method. Once again, you get to choose which properties take part, and after you do, ReSharper produces a neat implementation:

Code Block

public override string ToString()
{
  return string.Format("Name: {0}, Age: {1}", Name, Age);
}

...

Say you’re starting out with the following code:

Code Block

void AddPerson()
{
  using (var m = new Mongo("personnel", "localhost", "27017", string.Empty))
  {
    var coll = m.GetCollection<Person>("people");

    Person p = new Person("Jack", 20);
    coll.Insert(p);
  }
}

...

And here’s what ReSharper produces:

Code Block

private static Mongo GetDatabase()
{
  return new Mongo("personnel", "localhost", "27017", string.Empty);
}

...