MVC4, SimpleMembershipProvider, MySql and FluentNhibernate - mysql

I am trying to use SimpleMembership with MySql and I cant get it to work.
I downloaded the latest devart connector for MySql and followed the instructions on
http://www.devart.com/dotconnect/mysql/articles/extendedmembership-tutorial.html
The problem is that the WebSecurity class provided by devart, only has the InitializeDatabaseConnection method but it misses the rest of the methods WebMatrix.WebData has. (i.e UserExists(), CreateAccount(), etc )
Does anyone knows any implementation of WebSecurity alternative to WebMatrix.WebData?

We have implemented the InitializeDatabaseConnection method in the Devart.Common.Web.WebSecurity class because there was no way to override the corresponding method of the WebMatrix.WebData.WebSecurity class.
Other methods of the WebMatrix.WebData.WebSecurity class are supported in our implementation and can be used with Devart's SimpleMembership provider.

Related

Library class doesn't know of ConfigureWebHostDefaults extension method

I'm building a suite of REST micro-services using .Net Core 3.0 Preview 6. All these services will have the same start up logic. So, I'm trying to place all the code in a .Net Standard library.
The goal is to have the IHostBuilder:CreateHostBuilder method, as well as the Startup:Configure and Startup:ConfigureServices class and methods in the library. The library will also contain error handling logic, customized http response messages, etc.
However, I can't seem to find the correct package that contains the ConfigureWebHostDefaults method. I tried adding the Microsoft.AspNetCore package 2.2.0, but that didn't resolve the issue.
I added the Microsoft.Extensions.Hosting (3.0.0-preview-6) package, that also doesn't resolve the issue.
Is what I'm attempting even possible?
Thanks
-marc
I resolved it, not the best way, but it works. I decided to make the library targeted specifically for .NET Core 3.0. So, I changed the targetframework in the project file. That change automatically resolved my other issue.
Import the Microsoft.AspNetCore package, and use WebHost.CreateDefaultBuilder() instead. According to the code it is built from, both CreateDefaultBuilder() and ConfigureWebHostDefaults() call the same internal method: ConfigureWebDefaults().
The only downside of this is that the returned host will be an IWebHost instead of an IHost.

How to extending CI3 $this->db

I'm building a codeigniter 3(.1.9 older version) apps using mysql, I need to extend / override codeigniter $this->db,
so if myapps using
$this->db->insert
$this->db->update
$this->db->replace and
$this->db->delete
there will be a log in a file for CRUD actions.
You cannot Change/Modify/Replace Database classes.
According to CodeIgniter Official Documentation
"The Database classes can not be extended or replaced with your own classes. All other classes are able to be replaced/extended."
You can check the Official Documentation here.

How to use ExecuteStoreQuery or CreateQuery in EntityFramework?

I tried to use CreateQuery method or ExecuteStoreQuery by refrening the below link
Actually I need to Get the data using MYSQL query but i didn't find any method for that i am trying with the sql method in entity those are also not working, like this how to add MySQL query in Entity Framework?
http://www.entityframeworktutorial.net/Querying-with-EDM.aspx
I added both the namespace
using System.Data.Objects;
using System.Data.Entity;
still I didn't get those two methods can any one help me
Since ESQL was considered an advanced use case, there is no straightforward API from DbContext. You can access the ObjectContext that backs your DbContext to do what you want:
((IObjectContextAdapter)context).ObjectContext.CreateQuery<Person>("esql..")
Refer Below Link
Can't find CreateQuery() method

guice return set of instances with custom annotation

I have very simple scenario where class A registers instances for types.
A.register(T1.class, new H1());
A.register(T2.class, new H2());
this is fairly simple configuration when done by hand but guice injection doesn't work when I create instances outside the guice framework.
I try to figure out how to create and configure A with all instance with custom annotation using guice.
I have found something like this Scan the classpath for classes with custom annotation but it is not using guice.
thanks
so I guess code.google.com/p/google-guice/wiki/Multibindings is the only option so far that works, but it is not as nice as I would expect since you need to connect everything by hand.

Windsor Dependency Injection Problem with generics

I have an Interface IRepo <Entity>. I have a generic implementation Repo<Entity>.
Now i just do the following
Container.Register(AllTypes.FromAssemblyNamed("assemblyname").Pick()
.WithService.DefaultInterface()
.Configure(c => c.LifeStyle.PerWebRequest))
and register all the interface with respective implementations. This seems to work fine.
My Problem arises when i try to be more specific.
If i try to map IRepo<Person> with Person being a class subclassing Entity with <UserRepo> using
Container.Register(Component.For(IRepo<Person>).ImplementedBy(UserRepo).LifeStyle.PerWebRequest);
It does not seem to work.
The order in which i am doing this is that i am registering this specific implementation and then loading and registering all the interfaces to types from the assembly.
It does not seem to work.
DefaultInterface doesn't support generics. You can use AllInterfaces instead or a custom strategy via Select method