Entity Framework Dilemmas and Solutions in MVVM using contextual pluralization

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.

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 edited Revision 1. Comment: extra comments

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
  • mnoon edited Revision 1. Comment: extra comments

Page 1 of 1 (1 items)