Exemple #1
0
        public async Task <int> CreateOrUpdate(LienHeDto input)
        {
            if (input.Id > 0)
            {
                // update
                var updateData = await _blogRepos.GetAsync(input.Id);

                input.MapTo(updateData);

                await _blogRepos.UpdateAsync(updateData);

                return(1);
            }
            else
            {
                var insertData = input.MapTo <LienHe>();
                int id         = await _blogRepos.InsertAndGetIdAsync(insertData);

                return(id);
            }
        }