/ShopMarket.cs Secret
Last active
November 1, 2016 18:16
Model Partials for Relator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Umbraco.Core.Persistence; | |
namespace ProjectNamespace.Models.Generated | |
{ | |
public partial class ShopMarket | |
{ | |
[ResultColumn, JsonIgnore] // JsonIgnore if included means that the child data from this column wont be serialised and send down to Angualr. | |
public List<ShopZipcode> ShopZipcode { get; set; } | |
[ResultColumn] | |
public List<ShopMarketService> ShopMarketService { get; set; } | |
// Example helper method using related models. | |
public string PrimaryZipCode | |
{ | |
get | |
{ | |
if (ShopZipcode != null && ShopZipcode.Where(s => s.IsPrimary).Count() > 0) | |
return ShopZipcode.FirstOrDefault(s => s.IsPrimary).ZipCode; | |
else | |
return ""; | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Umbraco.Core.Persistence; | |
namespace ProjectNamespace.Models.Generated | |
{ | |
public partial class ShopMarketService | |
{ | |
public ShopService ShopService { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment