コード例 #1
0
        private TransformationSet CreateNewSet(string userName, string setName, List <TransformationViewModel> transformations, IExcelService destFile)
        {
            TransformationSet result = new TransformationSet();

            {
                result.Name     = setName;
                result.UserName = userName;
            }

            TransformationSet_Create(result);

            foreach (string columnName in destFile.ColumnNames.Values)
            {
                TransformationViewModel model = new TransformationViewModel
                {
                    TransformationSetId = result.Id,
                    TransformationRule  = "",
                    TargetColumn        = columnName
                };
                transformations.Add(model);
            }

            Transformations_Create(transformations);

            return(result);
        }
コード例 #2
0
        public void Transformations_Destroy(TransformationViewModel trans)
        {
            Transformation entity = new Transformation();

            entity.Id = trans.Id;

            _DemiContext.Transformations.Attach(entity);
            _DemiContext.Transformations.Remove(entity);
            _DemiContext.SaveChanges();
        }