Answered by:
Ria, Code first, many to many, inserts!

Question
-
I've created my pocos , the EF is correctly creating my mapping table. In one to many relationships the entity has a property for its one to many collections - So why, oh why, doesn't the entity with a many to many relationships create a property on the many to many entity that allows me to see the mappings. And more to the point how am i supposed to insert new mappings in.
public class CategoryDto { [Key] Guid CategoryId { get; set; } public List<ProductDto> Products { get; set; } public List<CategoryItemDto> CategoryItems { get; set; } } public class CategoryItemDto { [Key] public Guid CategoryItemDtoId{get;set;} Guid CategoryId { get; set; } } public class ProductDto { [Key] Guid ProductId { get; set; } public List<CatagoryDto> Categories { get; set; } } // // This is auto generated code // public class CategoryDtoEntity : Entity { Guid CategoryId { get; set; } public EntityCollection<CategoryItemDto> CategoryItemDtos {get;set;} // where is the many to many collection & likewise where is its // corresponding Property on the Producs table? // public EntityCollection<ProductDto> Categories { get; set; } }
Thanks in advance,
Yours(really getting cheesed off ;))
MK
- Edited by Kelbob Monday, February 6, 2012 4:43 PM
Monday, February 6, 2012 11:05 AM
Answers
-
Hi Kelbob,
Welcome!
For Code First Many to Many relationship, you can refer this link:
But I think you'd better to repost your question to http://forums.silverlight.net/53.aspx/1?WCF+RIA+Services for RIA service.
Thanks for understanding.
Have a nice day.
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Proposed as answer by Veysel Ugur KIZMAZ Wednesday, February 8, 2012 3:13 PM
- Marked as answer by Alan_chen Friday, February 17, 2012 9:07 AM
Tuesday, February 7, 2012 7:02 AM
All replies
-
Hi Kelbob,
Welcome!
For Code First Many to Many relationship, you can refer this link:
But I think you'd better to repost your question to http://forums.silverlight.net/53.aspx/1?WCF+RIA+Services for RIA service.
Thanks for understanding.
Have a nice day.
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Proposed as answer by Veysel Ugur KIZMAZ Wednesday, February 8, 2012 3:13 PM
- Marked as answer by Alan_chen Friday, February 17, 2012 9:07 AM
Tuesday, February 7, 2012 7:02 AM -
Hi,
I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?
If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.
Have a nice day.
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Wednesday, February 15, 2012 8:21 AM