Farseer.net Lightweight ORM Open Source Framework v1.x Introduction: View entity class mappings

Source: Internet
Author: User

Navigation

Catalog: Farseer.net Lightweight ORM Open source Framework Catalog

Previous: Farseer.net Lightweight ORM Open source framework v1.x : Table Data Manipulation

Filed under: Farseer.net Lightweight ORM Open source framework v1.x : Data manipulation of views

Objective

In V1.0, a map of the view is added. In previous versions, views were manipulated as "tables".

But our view is usually built for convenience. The table supports write operations. It will be very much out of tune (of course, the MSSQL view is also supported, but the view map here is for read-only views )

First look at the context in my demo with the View Entity association:

     Public class View:dbcontext<view>    {        "view_account")]          publicgetset;}    }

Its various views are encapsulated by Viewset : The operation of a series of queries provided against a database view. What is included in the Viewset is the View field.

VO entity class

1. View Entity class:

1  Public classAccountvo2 {3     /// <summary>User ID</summary>4      Public int? ID {Get;Set; }5     /// <summary>User name</summary>6      Public stringName {Get;Set; }7     /// <summary>Password</summary>8      Public stringPWD {Get;Set; }9     /// <summary>Login IP</summary>Ten[Field (Name ="getdate ()")] One      Public stringGetDate {Get;Set; } A}

In fact, the view is essentially the same as the entity of the table. That is, the view has the function, the table certainly has. (Internally, both Tableset and viewset inherit: Dbreadset (read-only query operation)).

Therefore, all the query operations in the Tableset. Viewset, too.

Attributes are also shared with the table's attributes. The others are the same except for the attribute attributes that are inserted and updated. So there is no more than one by one narration here.

Navigation

Catalog: Farseer.net Lightweight ORM Open source Framework Catalog

Previous: Farseer.net Lightweight ORM Open source framework v1.x : Table Data Manipulation

Filed under: Farseer.net Lightweight ORM Open source framework v1.x : Data manipulation of views

Advertising time

QQ Group:116228666 (farseer.net Open source frame exchange) Please specify:farseer.net

Farseer.net is an ORM framework + Common tool + extension collection.

Farseer implication: Prophets and seers usually offer tricks and strategies in certain situations. Also hope that the framework can provide you with maximum convenience.

ORM: The English name is:object relational(relationship) Mapping(map)

Farseer.net's goal is: Quick start, rapid development, simple and convenient.

1Table.data.User. Where (O=>o.id = =1). toentity ();2Table.data.User. Where (O=>o.id >1). ToList ();3Table.data.User. Where (o=>o.id! =0). Delete ();4Table.data.User. Where (o=>o.id! =0).Addup(O=>o.logincount,1);5Table.data.User. Where (O=>o.id = =1).Update(Newuser{UserName ="NewName" });6Table.data.User.Insert(Newuser{UserName ="NewName"});

Farseer.net Lightweight ORM Open Source Framework v1.x Introduction: View entity class mappings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.