TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
mnoon
(4Microsoft Partne)
When:
21 Jun 2013 7:29 PM
Last revision by
mnoon
(4Microsoft Partne)
When:
21 Jun 2013 7:36 PM
Revisions:
3
Comments:
1
Options
Subscribe to Article (RSS)
Share this
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
Entity Framework Dilemmas and Solutions in MVVM using contextual pluralization
Entity Framework Dilemmas and Solutions in MVVM using contextual pluralization
Article
History
Entity Framework Dilemmas and Solutions in MVVM using contextual pluralization
This is going to be a short article, but elicits advanced concepts in the entity framework 5 and is looking toward the future a little.
I recently posted an
article
on stackoverflow about a cat having some paws and on those paws claws with sharpness indexes.
Making a simple model like this I was like ok I have three entities and maybe two value types... cat name, and sharpness index.
Then I'm like ok I have been drilled to make all my entities plural.
Cats->Paws->Claws
But then I'm like... dude yo dude, Cat is one friggen Cat yo.
So contextually it should be
Cat->Paws->Claws
This phrase might be A single cat has 4 paws and each paw has a maximum of 5 claws.
Ok... so now there is a situations where maybe I can have Multiple cats..
Such as House->Cats where a single Cat->Paws->Claws
If you understand the pluralization concept here then you might just be able to fathom where the entity framework is going.
Now lets say I use MVVM utilizing the entity framework to create this object..
First I would properly pluralize my objects to show that I'm interested in one or more of the objects. Once its properly pluralized, now I can do stuff and properly connect those objects up in an mvvm crud environment.
Create(Cat) // this would mean create single cat like my last caty Snowy
Create(Cats) // this means I want to focus on all of the cats and maybe add like 50 gazillion cats from Garfield, Tom, Cat, Blacky, Frowny, etc...
So now I have a dilemma, how do I build a contextual relationship in the Entity framework based on proper pluralization? No clue... this is Microsoft Todo item I believe unless I can get it to work.
What problems should this solve. Well when I post the cat, it should be able to figure out that I also have these paws that should be created immediately after the cat was created in a transaction, and then after these 4 paws are created then it should automagically create the 5 claws for each paw and now finally link em all up. If there was an error kill the transaction and rollback with a fault result. I'm assuming that some of this magic is already taken care of by the entity framework. But in the database everything is named singular, or pluralized. So how can you switch pluralization connexts unless you have both a pluralized cats and a singularized cat.
Entity Framework
,
MVC 4
,
mvc 5
,
pluralization
[Edit tags]
Leave a Comment
Please add 3 and 3 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Sort by:
Published Date
|
Most Recent
|
Most Useful
Comments
mnoon
21 Jun 2013 7:36 PM
mnoon edited Revision 1. Comment: extra comments
Edit
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by:
Published Date
|
Most Recent
|
Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Posted by
mnoon
on
21 Jun 2013 7:36 PM
mnoon edited Revision 1. Comment: extra comments
Edit
Page 1 of 1 (1 items)