public async Task <ObjectConfigContract> GetById(Guid id) { objectContext = new ObjectContext(); ObjectConfig configs = await objectContext.ObjectConfigs.Find(x => x.Id == id).SingleOrDefaultAsync(); return(configs.ToContract()); }
public static ObjectConfigContract ToContract(this ObjectConfig objectConfig) { return(new ObjectConfigContract { Id = objectConfig.Id, Title = objectConfig.Title, Properties = objectConfig.Properties.Select(x => x.ToContract()).ToArray() }); }