Example #1
0
 public IActionResult UpdateMainMemory([FromBody] MainMemory mainMemory)
 {
     if (ModelState.IsValid)
     {
         var model = _mainMemoryAppService.UpdateMainMemory(mainMemory);
         return(Ok(model));
     }
     return(NotFound());
 }
        public bool UpdateMainMemory(MainMemory mainMemory)
        {
            var model = _dbContext
                        .MainMemorys
                        .FirstOrDefault(x => x.Id == mainMemory.Id);

            if (model != null)
            {
                model.Name         = mainMemory.Name;
                model.DisplayOrder = mainMemory.DisplayOrder;
                model.UpdatedDate  = mainMemory.UpdatedDate;
                model.Value        = mainMemory.Value;
                model.Published    = mainMemory.Published;
                _dbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
Example #3
0
 public Controller(int countSegments, int countLines, int countElements)
 {
     CountLines = countLines;
     MainMemo   = new MainMemory(countSegments, countLines, countElements);
     L          = new Cash(countLines, countElements);
 }
Example #4
0
 public MainMemoryInitializationTest()
 {
     mainMemory = new MainMemory();
 }
Example #5
0
 public Controller(int segmentsCount, int stringsCount, int elementsCount)
 {
     StringsCount         = stringsCount;
     MainMemoryController = new MainMemory(segmentsCount, stringsCount, elementsCount);
     CacheController      = new Cache(stringsCount, elementsCount);
 }
 public bool CreateMainMemory(MainMemory mainMemory)
 {
     _dbContext.MainMemorys.Add(mainMemory);
     _dbContext.SaveChanges();
     return(true);
 }
Example #7
0
 private void InitializeMainMemory()
 {
     mainMemory = new MainMemory();
 }