New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of EF4
' I watched Karl's video about validation with custom rules, and wondered
' why Silverlight, ASP.NET and ASP.NET MVC had DataAnnotations, and
' WPF only had IDataErrorInfo. So I thought of using EF4 as the model,
' and generating a metadata class like in RIA, MVC, etc for WPF and a
' inheritable generic class to convert the validations between IDataErrorInfo
' and the DataAnnotation attributes. 
'
' This way validation can happen the same way for each type of client!
'
' Let me know what you think please?
by rickrat   July 02, 2010 @ 3:54am
88 Views
no comments
 
C#
[OperationContract]
public Contact SaveContact(Contact entity)
{
    string _EntitySetName = "Contacts";
    
    using (MyContext _Context = new MyContext())
    {
        switch (entity.ChangeTracker.State)
        {
            case ObjectState.Added:
by Jerry Nixon   June 30, 2010 @ 10:33pm
Tags: EF4, WCF, CRUD
164 Views
no comments
 
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
 
Option Compare Binary
by rickrat   June 13, 2010 @ 4:51pm
64 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate