public static GAPCustomerPolicy ToEntity(this CustomerModel customerModel) { var entity = new GAPCustomerPolicy { GAPCustomerPolicy_Guid = customerModel.Id.IsEmpty() ? Guid.NewGuid() : customerModel.Id, CustomerLastName = customerModel.LastName, CustomerName = customerModel.Name, EntityState = customerModel.Id.IsEmpty() ? EntityState.Added : EntityState.Modified }; return(entity); }