Beispiel #1
0
        public void Update(ProjectDto item)
        {
            var data = (from r in MockDb.Projects
                        where r.Id == item.Id
                        select r).FirstOrDefault();

            if (data == null)
            {
                throw new DataNotFoundException("Project");
            }
            if (!data.LastChanged.Matches(item.LastChanged))
            {
                throw new ConcurrencyException("Project");
            }

            item.LastChanged = MockDb.GetTimeStamp();

            data.Name        = item.Name;
            data.Description = item.Description;
            data.Started     = item.Started;
            data.Ended       = item.Ended;
            data.LastChanged = item.LastChanged;
        }