Is it possible to use Linq-SQL without drag-and-drop? -


If I want to use linq-sql, then to move the db table to the designer's surface, For making.

I always like full control in my application and do not like sections created by dotnet.

Is it possible to make connections available between Linq and DB using Access Layer Entity Classes?

How can I do this?

You can easily write your own classes using Linux-to-SQL - just a few Painting your classes with classes is included.

  [table (name = " Categories ")] Public Category Category: IDataErrorInfo {[column (IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)] Public Ent ID {get; Set; } [Column] Public string name {get; Set; } [Column] Public string extension string {get; Set; }}  

This code was very easy, especially if you make your property names with the names of your table (you do not have to).

Then you just need a repository to connect to DB:

  category category repository: ICART entry table {Private table & lt; Category & gt; CategoryTable; Public category repository (string connection string) {categoryTable = (new datacontext (connection string)). GetTable & lt; Category & gt; (); }}  

Of course there is more to this, but this gives you basic information and once you understand it then it is not difficult to do it. This way you have 100% control on your classes and you can still take advantage of Linq-to-SQL.

I have learned this approach from the Pro ASP.NET MVC Framework .

If you want to see more, then opening all my Linux-to-SQL Classes has been written on one of your projects which you can browse.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -