protected override IEnumerable <IDataType> PerformGetByQuery(IQuery <IDataType> query) { Sql <ISqlContext> sqlClause = GetBaseQuery(false); var translator = new SqlTranslator <IDataType>(sqlClause, query); Sql <ISqlContext> sql = translator.Translate(); List <DataTypeDto>?dtos = Database.Fetch <DataTypeDto>(sql); return(dtos.Select(x => DataTypeFactory.BuildEntity(x, _editors, _dataTypeLogger, _serializer)).ToArray()); }
protected override IEnumerable <IDataType> PerformGetByQuery(IQuery <IDataType> query) { var sqlClause = GetBaseQuery(false); var translator = new SqlTranslator <IDataType>(sqlClause, query); var sql = translator.Translate(); var dtos = Database.Fetch <DataTypeDto>(sql); return(dtos.Select(x => DataTypeFactory.BuildEntity(x, _editors.Value, Logger)).ToArray()); }
protected override IEnumerable <IDataType> PerformGetAll(params int[]?ids) { Sql <ISqlContext> dataTypeSql = GetBaseQuery(false); if (ids?.Any() ?? false) { dataTypeSql.Where("umbracoNode.id in (@ids)", new { ids }); } else { dataTypeSql.Where <NodeDto>(x => x.NodeObjectType == NodeObjectTypeId); } List <DataTypeDto>?dtos = Database.Fetch <DataTypeDto>(dataTypeSql); return(dtos.Select(x => DataTypeFactory.BuildEntity(x, _editors, _dataTypeLogger, _serializer)).ToArray()); }
protected override IEnumerable <IDataType> PerformGetAll(params int[] ids) { var dataTypeSql = GetBaseQuery(false); if (ids.Any()) { dataTypeSql.Where("umbracoNode.id in (@ids)", new { ids }); } else { dataTypeSql.Where <NodeDto>(x => x.NodeObjectType == NodeObjectTypeId); } var dtos = Database.Fetch <DataTypeDto>(dataTypeSql); return(dtos.Select(x => DataTypeFactory.BuildEntity(x, _editors.Value, Logger)).ToArray()); }