public static Category MapCategory(XpoCategory category) { return(new Category { id = category.Oid, Name = category.Name, Description = category.Description, newObject = false }); }
public static XpoCategory MapCategory(Category category, UnitOfWork uow) { XpoCategory categoryReturned; if (category.newObject) { categoryReturned = new XpoCategory(uow) { Oid = category.id }; } else { categoryReturned = uow.GetObjectByKey <XpoCategory>(category.id); } categoryReturned.Name = category.Name; categoryReturned.Description = category.Description; return(categoryReturned); }