コード例 #1
0
        public async Task <int> SaveColorAsync(MstrColor mstrColor)
        {
            DynamicParameters para = new DynamicParameters();

            para.Add("AutoId", mstrColor.AutoId);
            para.Add("Code", mstrColor.Code.ToUpper().Trim());
            para.Add("Name", mstrColor.Name.ToUpper().Trim());
            para.Add("LinkColor", mstrColor.LinkColorCard);
            para.Add("UserId", mstrColor.CreateUserId);
            para.Add("@Result", dbType: DbType.Int32, direction: ParameterDirection.Output);

            var result = await DbConnection.ExecuteAsync("spMstrColorSave", para
                                                         , commandType : CommandType.StoredProcedure);

            return(para.Get <int>("Result"));
        }
コード例 #2
0
        public async Task <ActionResult> SaveColor(MstrColor color)
        {
            var result = await _masterRepository.SaveColorAsync(color);

            return(Ok(result));
        }