Does ServiceStack now support Oracle.ManagedDataAccess.Client? - odp.net

ServiceStack.OrmLite.Oracle OracleOrmLiteDialectProvider.cs class uses Oracle.ManagedDataAccess.Client here. But the Oracle Provider Notes still tells that the Oracle provider requires an installation of Oracle's unmanaged ODP.NET here.
If the ServiceStack Oracle Provider Notes are still valid, why does ServiceStack.OrmLite.Oracle use Oracle.ManagedDataAccess.Client and not the unmanaged Oracle.DataAccess.Client?

Related

Using ActivatorUtilities.CreateInstance<Service> in razor components

ActivatorUtilities.CreateInstance requires a service provider in order to properly resolve. The service provider is whats being used when resolving injected properties in razor components/pages.
If I want to make use of this in my razor components/pages, do I need to also inject a service provider or a means to get a service provider like through iservicescopefactory? Seems somewhat repetitive but not sure if there's an alternative to this approach.
Background: What I'd like to do is use this utility function to create services that require state values to properly instantiate (values not available when initially constructing the service collection in program.cs) while also leveraging the services already available in my service provider. Not sure if it makes sense to use this to continue making use of di or to just manually construct the class on the fly using the state values

What is the difference of credential-store and secret-key-credential-store

In the following table the different credential store implementations of different credential types are listed.
Credential Type
KeyStoreCredentialStore
PropertiesCredentialStore
PasswordCredential
Supported
Unsupported
KeyPairCredential
Supported
Unsupported
SecretKeyCredential
Supported
Supported
I still do not quite understand the difference of KeyStoreCredentialStore (credential-store) and PropertiesCredentialStore (secret-key-credential-store) in wildfly subsystem elytron. If KeyStoreCredentialStore supports SecretKeyCredential, why one need PropertiesCredentialStore type?
An official documentation describe the differences of credential store implementations with details very well. However, for someone starting new with this topic, it can be confusing. Hence, I thought of briefly describing the differences and practical benefits based on my experience:
KeyStoreCredentialStore (i.e. credential-store) and PropertiesCredentialStore (i.e. secret-key-credential-store) are two default credential store implementations WildFly Elytron contain.
KeyStoreCredentialStore implementation backed by a Java KeyStore which is protected using the mechanisms provided by the KeyStore implementations. As listed in table above it supports credential types as PasswordCredential, KeyPairCredential and SecretKeyCredential.
PropertiesCredentialStore is another implementation dedicated to store SecretKeyCredential using a properties file and its primary purpose is to provide an initial key to a server environment. It does not offer any protection of the credentials it stores but can be still from filesystem level its access restricted to just the application server process.
In my case I needed e.g. SecretKeyCredential to encrypt expression (i.e. passwords in clear text) in server configuration file and I added my SecretKey to KeyStoreCredentialStore protected by password, rather than using PropertiesCredentialStore.

Where is .AddDbContext method?

Everywhere it's said to call services.AddDbContext<> method but it is not recognized inside the ConfigureServices(IServiceCollection services) method.
What am I doing wrong?
You have to reference the correct package first, which depends on the EF Core provider you want to use.
Microsoft.EntityFrameworkCore.SqlServer for SQL Server, Microsoft.EntityFrameworkCore.Sqlite for SQLite and Microsoft.EntityFrameworkCore.InMemory for in memory (only for testing).
These are the official out-of-the-box providers. There are also 3rd party providers for PostgreSQL, MySQL, etc. The documentation providers a list of available 3rd party providers here.
Also depending on the provider you may also need to declare a certain namespace. The built-in providers are declared in Microsoft.Extension.DependencyInjection namespace so you need to add a using Microsoft.Extension.DependencyInjection; to the top of your Startup.cs.
Other providers (Oracle's MySQL provider for example) uses MySQL.Data.EntityFrameworkCore.Extensions namespace, so you need to define this using using MySQL.Data.EntityFrameworkCore.Extensions;
Note when actually writing the using you only have to reference Microsoft.EntityFrameworkCore omitting the specific package name. Providing it seems to throw an error.

compability of data types between java client and wcf service

I am developing a WCF Service application with basicHttpBinding option. I chosed basicHttpBinding because my client could be a Java client, a Visual Basic Client etc.
Now i want to be sure that the datatypes which i used in my application are compatible and consumable with Java clients or other platform languages.
For instance, Which of the following .NET datatypes can be used without affacting interoperatablitiy?
DateTime
int
double
double?
float
float?
string
I answer my own question.
I found a resource which tells the interoperability of data types between .Net server and Java client.
The documantation
The documantation says that using nullable data types wont make any headache to developers. However, i wont use nullable datatypes like double? int? etc. I will assing default values insead.

Entity Framework 4.0 - Can I send a complex type to the client over WCF?

Hey, can anybody confirm the following scenario will work:
I am developing a 3-tier application in .NET 4.0: Winforms Client, aspx server and SQL 2008 database.
The server communicates with the SQL 2008 database by means of Entity Framework 4.0, and returns the entities in forms of STE's (in a separate assembly) to the client application over WCF.
Now I want to execute a stored procedure on the SQL server, which will return me a custom shaped dataformat (not a 1:1 mapping with an entity). I read that I could use complex types to hold the data this will return to me.
Now the question: will this complex type be serializable over WCF so the client can work with it too ? I suppose it is, but cannot seem to find a closing answer anywhere, and I wanna be sure before I proceed with my coding.
Thx !
TJ
Anything that can be represented in an XML Schema can be serialized and thus sent across the wire using WCF.
This includes all .NET basic primitive types like int, double, string, DateTime and any classes built from those.
Things that won't work are for instance:
any .NET specifics (like Exception, generics, ...) - remember, WCF is designed to be interoperable, not just between two .NET clients
anything with inherent behavior (like a Dictionary)
If you return complex types to the wcf service or if you return an entity whose one of the property is of complex type, self tracking entity would have no problems. However if you are using RIA services, the complex types is not supported.