public static ModelLibrary.Restaurant ConvertRestaurantToModel(DatabaseAccessLibrary.Restaurant dbRestaurant)
        {
            var mRes = new ModelLibrary.Restaurant
            {
                Name         = dbRestaurant.name,
                Address      = dbRestaurant.address,
                Email        = dbRestaurant.email,
                Id           = dbRestaurant.id,
                PhoneNo      = dbRestaurant.phoneNo.ToString(),
                Verified     = dbRestaurant.verified,
                ZipCode      = dbRestaurant.zipcode.ToString(),
                Category     = ConvertRestaurantCategoryToModel(dbRestaurant.ResCat),
                Discontinued = dbRestaurant.discontinued,
            };

            //mRes.Category = ConvertRestaurantCategoryToModel(dbRestaurant.ResCat);

            // if(dbRestaurant.resCatId != null)
            //     mRes.CategoryId = dbRestaurant.resCatId.Value;

            return(mRes);
        }
        public static DatabaseAccessLibrary.Restaurant ConvertRestaurantToDatabase(ModelLibrary.Restaurant mRes)
        {
            if (mRes == null)
            {
                return(null);
            }
            int PhoneNo = 0;
            int ZipCode = 0;

            try
            {
                ZipCode = Int32.Parse(mRes.ZipCode);
                PhoneNo = Int32.Parse(mRes.PhoneNo);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            var dbRes = new DatabaseAccessLibrary.Restaurant();

            dbRes.name         = mRes.Name;
            dbRes.address      = mRes.Address;
            dbRes.email        = mRes.Email;
            dbRes.id           = mRes.Id;
            dbRes.phoneNo      = PhoneNo;
            dbRes.verified     = mRes.Verified;
            dbRes.zipcode      = ZipCode;
            dbRes.discontinued = mRes.Discontinued;
            if (mRes.Category != null)
            {
                dbRes.resCatId = mRes.Category.Id;
            }

            return(dbRes);
        }