Пример #1
0
        // using Dapper
        //public IEnumerable<Issue> GetAll()
        //{
        //    using (IDbConnection db = new SqlConnection(_connectionString))
        //    {
        //        var data = db.Query<Issue, Project, Issue>(
        //            "SELECT * FROM Issues INNER JOIN Projects ON Issues.ProjectId = Projects.Id",
        //            map: (issue, project) =>
        //            {
        //                issue.Project = project;
        //                return issue;
        //            },
        //            splitOn: "Id"
        //        );
        //        return data;
        //    }
        //}

        public void Update(Project value)
        {
            var builder = new SqlQueryBuilder <Project>(value);

            ExecuteCommand(builder.GetUpdateCommand());
            //using (IDbConnection db = new SqlConnection(_connectionString))
            //{
            //    var sqlQuery = "UPDATE Projects SET Name = @Name WHERE Id = @Id"; //TODO
            //    db.Execute(sqlQuery, value);
            //}
        }
Пример #2
0
        public void Update(Issue value)
        {
            var builder = new SqlQueryBuilder <Issue>(value);

            ExecuteCommand(builder.GetUpdateCommand());
        }