DDS Read not Consistent

Vote:
 

Hi,

I am trying to read Data from Dynamic Data Store using below code

using (var store = typeof(DataStorage.SenderInfo).GetOrCreateStore())
{
var selectSingle = customerCodes.Count == 1;
store.Refresh();
var data = store.Items<DataStorage.SenderInfo>().ToList()
.Where(x => (selectSingle && customerCodes.Contains(x.CompanyCode)) ||
x.IsGlobalSender)
.OrderBy(x => x.CompanyName)
.ThenBy(x => x.Name)
.ToList();

var senders = data.Select(MapToSenderInfoEntity).ToList();
return senders;
}

[EPiServerDataStore(AutomaticallyRemapStore = true, AutomaticallyCreateStore = true)]
internal class SenderInfo : IDynamicData
{
public Identity Id { get; set; }
public string Name { get; set; }
public string Initials { get; set; }
public string ImageUrl { get; set; }
public string CompanyCode { get; set; }
public int ContentId { get; set; }
public string CompanyName { get; set; }
public bool IsGlobalSender { get; set; }
}

However, the result of the above snippet is not Consistent sometime I am able to get data and sometimes null

Not sure what's wrong

Any Suggestions?

 

#210936
Dec 12, 2019 13:03
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.