/// <summary> /// Maps a DAL.Example to Business.Example maintaining some original values passed in "rtn" parameter /// </summary> /// <param name="source"></param> /// <param name="rtn"></param> /// <returns></returns> public static DAL.Entities.Example MapInverse(this Example source, DAL.Entities.Example rtn) { if (source != null && rtn != null) { rtn.ID = source.ID; rtn.MyIntegerProperty = source.MyIntegerProperty; rtn.MyStringProperty = source.MyStringProperty; rtn.MyNullableProperty = source.MyNullableProperty; rtn.DateCreation = source.DateCreation; rtn.UserCreation = source.UserCreation; rtn.DateLastChange = source.DateLastChange; rtn.UserLastChange = source.UserLastChange; return(rtn); } else { return(null); } }
/// <summary> /// Maps a DAL.Example to Business.Example /// </summary> /// <param name="source"></param> /// <returns></returns> public static Example Map(this DAL.Entities.Example source) { if (source != null) { return new Example() { ID = source.ID, MyIntegerProperty = source.MyIntegerProperty, MyStringProperty = source.MyStringProperty, MyNullableProperty = source.MyNullableProperty, DateCreation = source.DateCreation, UserCreation = source.UserCreation, DateLastChange = source.DateLastChange, UserLastChange = source.UserLastChange } } ; else { return(null); } }