I want to use two different data sources in my Azure project:
In this way I can combine the powerful of SQL Server with the easy scalability of Windows Azure Storage.
Imagine this Domain POCO class:
class Person
{
string Id { get; set; }
string Name { get; set; }
byte[] Picture { get; set; }
string Biography { get; set; }
}
I would like to use Entity Framework with fluent mapping to let EF understand that the properties Picture and Biography must be loaded from Windows Azure Storage (table, blob) instead of SQL Server (possibly Lazy loaded).
There's a way with EF (or NHibernate) to do this or I have to implement my own ORM strategy?
Thanks
Azure tables are only cheaper than SQL Azure if the data access pattern is relatively light, since tables have a per-transaction fee and SQL Azure doesn't.
Most customers use managed disks, available in a number of offerings: Standard HDD, Standard SSD, Premium SSD, and Ultra SSD. Managed disks are highly recommended to use over unmanaged disks (see Azure Managed vs Unmanaged disks : The choice). You create and then attach one or more managed disks to the VM.
Sign into the Azure portal. Navigate to your virtual machine, select Disks under Settings. Choose the appropriate caching policy for your disk from the drop-down. After the change takes effect, reboot the SQL Server VM and start the SQL Server service.
I don't think you can let EF know about Azure storage but you can map only necessary properties to a specific table. For example,
modelBuilder.Entity<Person>().Ignore(p => p.Picture);
So assuming that you have a repository class for your Person class, what you want can be easily achieved by filling the repository class with Azure storage API and EF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With