using Gremlin.GremlinData.DBClasses;
using Gremlin.GremlinData.EntityClasses;
using System;
using System.Collections.ObjectModel;
using System.Linq;

namespace Gremlin.GremlinUI.ViewModels
{
    internal class AccountVM : BaseVM
    {
        public static ObservableCollection<Account> GetAccounts()
        {
            try
            {
                using (GremlinContext gremlinContext = new())
                {
                    return new ObservableCollection<Account>(gremlinContext.Accounts.ToList());
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.ShowErrorInMessageBox(ex);
                return null;
                throw;
            }
        }
    }
}