public async Task <IEnumerable <Author> > GetAllAuthors() { List <AuthorPostgreSql> authorListResult = await db.Authors.ToListAsync(); IEnumerable <Author> auhorsEnumResult = null; if (authorListResult != null) { PostgreSqlDataConvert.InitData(authorListResult); auhorsEnumResult = PostgreSqlDataConvert.GetFormatedEnumResult(); } return(auhorsEnumResult); }
public async Task <IEnumerable <Author> > GetAllAuthors() { var builder = Builders <AuthorMongoDb> .Filter; var filters = new List <FilterDefinition <AuthorMongoDb> >(); List <AuthorMongoDb> CollectionResult = await db.Authors.Find(builder.Empty).ToListAsync(); IEnumerable <Author> authorEnumResult = null; if (CollectionResult != null) { mongoDbDataConvert.InitData(CollectionResult); authorEnumResult = mongoDbDataConvert.GetFormatedEnumResult(); } return(authorEnumResult); }