public static async Task <bool> Exists(this ITextItemTypeRepository repository, Guid identity) { var textItemTypeIdentity = TextItemTypeIdentity.From(identity); var exists = await repository.Exists(textItemTypeIdentity); return(exists); }
public async Task <TextItemTypeIdentity> GetItemType(TextItemIdentity identity) { var textItemTypeIdentity = await this.ExecuteInContextAsync(async dbContext => { var textItemTypeGuid = await dbContext.TextItems.Where(x => x.GUID == identity.Value).Select(x => x.TextItemType.GUID).SingleAsync(); var output = TextItemTypeIdentity.From(textItemTypeGuid); return(output); }); return(textItemTypeIdentity); }
public async Task <TextItemTypeIdentity> GetIdentity(string name) { var identity = await this.ExecuteInContextAsync(async dbContext => { var guid = await dbContext.TextItemTypes.Where(x => x.Name == name).Select(x => x.GUID).SingleAsync(); var output = TextItemTypeIdentity.From(guid); return(output); }); return(identity); }
public async Task <TextItemType> Get(TextItemTypeIdentity identity) { var textItemType = await this.ExecuteInContextAsync(async dbContext => { var entity = await dbContext.TextItemTypes.Where(x => x.GUID == identity.Value).SingleAsync(); var output = new TextItemType() { Identity = TextItemTypeIdentity.From(entity.GUID), Name = entity.Name, }; return(output); }); return(textItemType); }
public async Task <TextItemType> Get(string name) { var textItemType = await this.ExecuteInContextAsync(async dbContext => { var entity = await dbContext.TextItemTypes.Where(x => x.Name == name).SingleAsync(); var output = new TextItemType() { Identity = TextItemTypeIdentity.From(entity.GUID), Name = entity.Name, // Use entity name, not the input name for exactness. }; return(output); }); return(textItemType); }