/// <summary>
        /// Create a new MarketArea object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        public static MarketArea CreateMarketArea(global::System.Guid id)
        {
            MarketArea marketArea = new MarketArea();

            marketArea.Id = id;
            return(marketArea);
        }
        public void AddMarketAreaTest()
        {
            //Add first
            _repository.Add(marketAreaStub);
            _repository.SaveChanges();

            //Check whether on database or not
            area = _repository.GetById(marketAreaStub.Id);
            Assert.IsNotNull(area, "Market Area Baru Berhasil Terbuat");

            //Delete so this method can be used again
            _repository.Delete(marketAreaStub);
            _repository.SaveChanges();
        }
        public MarketAreaServiceResponse Create(MarketAreaDomain marketArea)
        {
            MarketAreaServiceResponse response = new MarketAreaServiceResponse();

            if (!validateIsNotExist(marketArea.Id))
                response.Messages.Add(new Message("Data is already on database"));
            else
            {
                marketAreaEntity = new MarketArea();
                MergeExtension.Merge(marketAreaEntity, marketArea);
                _marketAreaRepository.Add(marketAreaEntity);
                _marketAreaRepository.SaveChanges();
            }

            return response;
        }
        public void DeleteMarketAreaTest()
        {
            //Add first to make data dummy
            _repository.Add(marketAreaStub);
            _repository.SaveChanges();

            //Delete
            _repository.Delete(marketAreaStub);
            _repository.SaveChanges();

            //make sure wheter data is no longer in database
            area = _repository.GetById(marketAreaStub.Id);
            Assert.IsNull(area, "Area Belum Terhapus");
        }
        public void UpdateMarketAreaTest()
        {
            //Add first
            _repository.Add(marketAreaUpdateStub);
            _repository.SaveChanges();

            _repository.Update(marketAreaUpdateStub1);
            _repository.SaveChanges();

            area = _repository.GetById(marketAreaUpdateStub1.Id);

            Assert.AreEqual(marketAreaUpdateStub1.City, area.City);

            //Delete so this method can be used again
            _repository.Delete(marketAreaUpdateStub1);
            _repository.SaveChanges();
        }
        public void GetByNameMarketAreaTest()
        {
            //Add first to make data dummy
            _repository.Add(marketAreaStub1);
            _repository.SaveChanges();

            //test case
            area = _repository.GetById(marketAreaStub1.Id);
            Assert.IsNotNull(area);

            //Delete
            _repository.Delete(marketAreaStub1);
            _repository.SaveChanges();
        }
 /// <summary>
 /// Create a new MarketArea object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static MarketArea CreateMarketArea(global::System.Guid id)
 {
     MarketArea marketArea = new MarketArea();
     marketArea.Id = id;
     return marketArea;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the MarketAreas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMarketAreas(MarketArea marketArea)
 {
     base.AddObject("MarketAreas", marketArea);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the MarketAreas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMarketAreas(MarketArea marketArea)
 {
     base.AddObject("MarketAreas", marketArea);
 }