protected override object ReadRow(IRowReader reader) { LightboxBrand lightboxBrand = LightboxBrand.New(); // Table Fields lightboxBrand.LightboxBrandId = reader.GetInt32("LightboxBrandId"); lightboxBrand.LightboxId = reader.GetInt32("LightboxId"); lightboxBrand.BrandId = reader.GetInt32("BrandId"); lightboxBrand.IsDirty = false; lightboxBrand.ChangedProperties.Clear(); return(lightboxBrand); }
public static Lightbox Update(Lightbox lightbox) { Lightbox lb = LightboxMapper.Instance.Update(lightbox); LightboxBrandMapper.Instance.DeleteLightboxBrands(lb.LightboxId); foreach (Brand brand in lb.Brands) { LightboxBrand o = LightboxBrand.New(); o.LightboxId = lb.LightboxId.GetValueOrDefault(); o.BrandId = brand.BrandId.GetValueOrDefault(); LightboxBrand.Update(o); } return(lb); }