Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

New Post: Resource based Pre-Generated Views

$
0
0

What is the reasoning for having the CompressingHashBuilder internal and not public?   I can use the ComputeHash static function on the StringHashBuilder but not sure how much memory that will chew up on large models.

Here's the logic we used internally when we decompiled the classes and made them public (which I believe is the same logic EF uses when it generates it's view file)

 

var resourceHaser = new CompressingHashBuilder(new SHA256CryptoServiceProvider());
 for (int i = 0; i < viewCount; i++) 
{ 
   KeyValuePair<string, string> resourceValue = resourceDictionary[i]; 
   resourceHaser.AppendLine(resourceValue.Key); 
   resourceHaser.AppendLine(resourceValue.Value); 
} 
string fileHash = resourceHaser.ComputeHash(); 
return sourceHash == fileHash;

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>