public IEnumerable <Category> GetCategoryBooks(int category) { CategoryType categoryType = (CategoryType)category; IEnumerable <Category> res = SqlMapperExtensions.GetAll <Category>(_connectionString).Where(x => x.CategoryType == categoryType); return(res); }
public IEnumerable <TaskItem> GetItem(string id) { using (IDbConnection db = new SqlConnection(connectionString)) { var res = SqlMapperExtensions.GetAll <TaskItem>(db).Where(x => x.UserId == id); return(res); } }
public IEnumerable <Category> GetAutorAndCategoryBook(string avtor, int category) { List <Category> bookList = new List <Category>(); CategoryType categoryType = (CategoryType)category; bookList.AddRange(SqlMapperExtensions.GetAll <Category>(_connectionString).Where(x => x.CategoryType == categoryType).ToList()); return(bookList); }
public IEnumerable <TaskItem> GetAll() { using (IDbConnection db = new SqlConnection(connectionString)) { var res = SqlMapperExtensions.GetAll <TaskItem>(db); return(res); } }
public IEnumerable <Notification> GetNotificationsForMessage(string uniquecustomerid, string messageid) { List <Notification> notifications = null; using (var conn = Connection) { notifications = SqlMapperExtensions.GetAll <Notification>(conn, Transaction).Where(cuid => cuid.CustomerUniqueId == uniquecustomerid && cuid.MessageName == messageid).Take <Notification>(1000).ToList <Notification>(); } return(notifications); }
public IEnumerable <Notification> GetNotificationsForCustomer(string uniquecustomerid) { List <Notification> notifications = null; _logger.LogError("About to connect"); using (var conn = Connection) { _logger.LogError("In Connection Loop"); notifications = SqlMapperExtensions.GetAll <Notification>(conn, Transaction).Where(cuid => cuid.CustomerUniqueId == uniquecustomerid && cuid.ClientNotified == false).Take <Notification>(1000).ToList <Notification>(); _logger.LogError("Got the notifications"); foreach (var notification in notifications) { _logger.LogError("updating notifications for" + notification.CustomerUniqueId); notification.ClientNotified = true; conn.Update(notification, Transaction); } Transaction.Commit(); } return(notifications); }
public IEnumerable <T> GetAll() { IEnumerable <T> entities = SqlMapperExtensions.GetAll <T>(_connection); return(entities); }
public Person GetPersonByRefreshToken(string refreshToken) { Person person = SqlMapperExtensions.GetAll <Person>(_connectionString).Where(x => x.RefreshToken == refreshToken).FirstOrDefault(); return(person); }
public Person GetPersonByLoginAndPassword(string login, string password) { Person person = SqlMapperExtensions.GetAll <Person>(_connectionString).Where(x => x.Login == login && x.Password == password).SingleOrDefault(); return(person); }
public IEnumerable <TEntity> GetAll() { return(SqlMapperExtensions.GetAll <TEntity>(_connection, _transaction, _commandTimeout)); }
public IEnumerable <TEntity> GetAll() { IEnumerable <TEntity> results = SqlMapperExtensions.GetAll <TEntity>(connection.Connect); return(results); }