public Mansion Insert(Mansion item)
        {
            var inserted = Mansions.Add(item);

            _ctx.SaveChanges();

            return(inserted);
        }
        public void Update(Mansion item)
        {
            var updated = Mansions.FirstOrDefault(x => x.UniqueId == item.UniqueId);

            updated.Address    = item.Address;
            updated.TotalFunds = item.TotalFunds;

            _ctx.SaveChanges();
        }
 public static MansionViewModel ToViewModel(this Mansion item)
 {
     return(new MansionViewModel
     {
         Id = item.UniqueId,
         Address = item.Address,
         TotalFunds = item.TotalFunds,
         Users = item.Users.Select(x => x.ToViewModel()).ToList(),
         Bills = item.Bills.Select(x => x.ToViewModel()).ToList(),
         Consumptions = item.Consumptions.Select(x => x.ToViewModel()).ToList()
     });
 }
    static void Main()
    {
        Cottage cottage = new Cottage();

        cottage.CottageInfo();

        Flat flat = new Flat();

        flat.FlatInfo();

        Mansion mansion = new Mansion();

        mansion.MansionInfo();

        Console.ReadLine();
    }
示例#5
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        _mansionFacet            = new Mansion();
        _choicesFacet            = new ChoiceMaker();
        _playerFacet             = new Player();
        _creatureManagerFacet    = new CreatureManager();
        EventDelegate.StartGame += OnGameStart;
    }
示例#6
0
    public void Awake()
    {
        //loveInterests = new List<LoveInterest>(GameObject.FindObjectsOfType<LoveInterest>());
        mansion = GameObject.FindObjectOfType <Mansion>();

        sfxManager           = GameObject.FindObjectOfType <SFXManager>();
        bgmManager           = GameObject.FindObjectOfType <BGMManager>();
        dialogControls       = GameObject.FindObjectOfType <DialogController>();
        mapControls          = GameObject.FindObjectOfType <MapController>();
        diaryControls        = GameObject.FindObjectOfType <DiaryController> ();
        timeUI               = GameObject.FindObjectOfType <TimeUI>();
        backgroundControls   = GameObject.FindObjectOfType <BackgroundController>();
        foregroundControls   = GameObject.FindObjectOfType <ForegroundController>();
        loveInterestControls = GameObject.FindObjectOfType <LoveInterestSelectController>();
        screenFader          = GameObject.FindObjectOfType <ScreenFader>();
        dayControls          = GameObject.FindObjectOfType <DayManager>();

        instance = this;
    }
示例#7
0
 public void Update(Mansion item)
 {
     _mansionRepository.Update(item);
 }
示例#8
0
 public Mansion Insert(Mansion item)
 {
     return(_mansionRepository.Insert(item));
 }