Beispiel #1
0
        public void SaveUnit(UnitWrapper wrapper)
        {
            UnitWrapper4Mongo wrapper4Mongo = new UnitWrapper4Mongo(wrapper);
            var reload = LoadUnit(wrapper.UnitId);

            if (reload != null)
            {
                wrapper4Mongo.Id = (reload as UnitWrapper4Mongo).Id;
            }
            _proxy.Unit.Save(wrapper4Mongo);
        }
Beispiel #2
0
        public UnitWrapper LoadUnit(Guid id)
        {
            UnitWrapper4Mongo wrapper = _proxy.Unit.FindOneAs <UnitWrapper4Mongo>(Query <UnitWrapper4Mongo> .EQ(e => e.UnitId, id));

            return(wrapper);
        }