SHARE
TWEET

Untitled

a guest Sep 16th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static class DataStoreInfo
  2. {
  3.     public static (string DataDomain, string StoreName) For<TDataModel>() => DataStoreAttributeInfo<TDataModel>.Data;
  4.  
  5.     private static class DataStoreAttributeInfo<TDataModel>
  6.     {
  7.         public static readonly (string DataDomain, string StoreName) Data = typeof(TDataModel)
  8.           .GetCustomAttributes(typeof(DataStoreAttribute), true)
  9.           .Cast<DataStoreAttribute>()
  10.           .Select(s => (s.DataDomain, s.StoreName))
  11.           .FirstOrDefault();
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top