public static MVC.ProjectResult MapBusinessToMvc(BL.ProjectResult source) { if (source == null) { return(null); } MVC.ProjectResult target = new MVC.ProjectResult(); target.ProjectResultId = source.Id; target.ProjectResultVersion = source.Version; target.ProjectResultText = source.Text; return(target); }
public static BL.ProjectResult MapMvcToBusiness(MVC.ProjectResult source) { if (source == null) { return(null); } BL.ProjectResult target = BL.ProjectResult.GetOrCreate(MapSupport.ActiveCtx, source.ProjectResultId); if (target.Version != Guid.Empty && target.Version != source.ProjectResultVersion) { throw new DataException("Concurrency check failed"); } if (source.ProjectResultIsDeleted) { target.Delete(MapSupport.ActiveCtx); return(null); } else { target.Version = source.ProjectResultVersion; target.Text = source.ProjectResultText; } return(target); }
public static MVC.ProjectResult MapBusinessToMvc(BL.ProjectResult source) { if(source == null) return null; MVC.ProjectResult target = new MVC.ProjectResult(); target.ProjectResultId = source.Id; target.ProjectResultVersion = source.Version; target.ProjectResultText = source.Text; return target; }