예제 #1
0
        public T FirstOrDefault(int id)
        {
            DataRow row = MyDbConnection.SelectById(TableName, id);

            if (row == null)
            {
                return(EmptyModel());
            }
            return(CreateModel(row));
        }
예제 #2
0
        public T FirstOrFail(int id)
        {
            DataRow row = MyDbConnection.SelectById(TableName, id);

            if (row == null)
            {
                throw new Exception("Not found");
            }
            return(CreateModel(row));
        }