Exemplo n.º 1
0
        public Response Add(TEntity value)
        {
            Response response = new Response();

            try
            {
                var exist = List().listings.Where(x => x.prop_address.ToLower() == value.prop_address.ToLower());
                if (exist.Count() > 0)
                {
                    response.Status      = false;
                    response.Description = "Record already exists";
                    return(response);
                }
                using (IDbConnection conn = GetConnection())
                {
                    conn.Insert(value);
                    response.Status      = true;
                    response.Description = "Successful";
                }
            }
            catch (Exception ex)
            {
                response.Status      = false;
                response.Description = ex.Message;
            }
            return(response);
        }
Exemplo n.º 2
0
        public Response Update(TEntity value)
        {
            Response response = new Response();

            try
            {
                using (IDbConnection conn = GetConnection())
                {
                    conn.Update(value);
                    response.Status      = true;
                    response.Description = "Successful";
                }
            }
            catch (Exception ex)
            {
                response.Status      = false;
                response.Description = ex.Message;
            }
            return(response);
        }