public static FieldInBundle AddField(this Bundle bundle, Database dc, FieldInBundle field) { if (field.IsExist <FieldInBundle>(dc)) { return(field); } if (String.IsNullOrEmpty(field.Id)) { field.Id = Guid.NewGuid().ToString(); } dc.Table <FieldInBundle>().Add(field); return(field); }
public static FieldInBundle AddField(this Bundle bundle, EntityDbContext dc, FieldInBundle field) { if (field.IsExist <FieldInBundle>(dc)) { return(field); } if (String.IsNullOrEmpty(field.Id)) { field.Id = Guid.NewGuid().ToString(); field.Status = EntityStatus.Active; field.UpdatedTime = DateTime.UtcNow; } dc.FieldInBundle.Add(field); return(field); }