Azure mobile app with existing sql backend - azure-sql-database

I have been following these examples in a previous stack overflow example, I need to convert to an Integer id to an Azure mobile app, and need a MappingDomainManager class described by user Kiske1 in the post below.
Azure Mobile App using existing database
However, I have been unable to complete this as Automapper.impl.PropertyAccessor is “Type of namespace Impl does not exist…” I am using the latest Automapper dll v6.1.1.0.
Does anyone know where PropertyAccessor has been moved to/or replaced with?
Also, both examples that were specified in this post are from 2014, does anyone know of a more up to date walkthrough and preferably an example project?

Does anyone know where PropertyAccessor has been moved to/or replaced with?
I searched at AutoMapper project and found that PropertyAccessor has been removed. Also, I checked my mobile app project and the Automapper version is 3.3.1, the PropertyAccessor exists and the old sample could work. I assumed that you could try to downgrade the version of your Automapper to fix this issue.
does anyone know of a more up to date walkthrough and preferably an example project?
For Automapper 6.1.1, the usage for FindTypeMapFor method and the parameter type for GetExistingPropertyMapFor method have changed, you could modify your code under SimpleMappedEntityDomainManager as follows:
var m = Mapper.FindTypeMapFor<TModel, TData>();
m.GetExistingPropertyMapFor(new PropertyAccessor(typeof(TData).GetProperty("Id")));
To
var m = Mapper.Configuration.FindTypeMapFor<TModel, TData>();
m.GetExistingPropertyMapFor(typeof(TData).GetProperty("Id"));
Moreover, you could refer to adrian hall's book about The Domain Manager.

Related

Dynamics 365 - 'PluginAssembly' entity doesn't contain attribute

When create a connection using PluginRegistration, I was getting the error below.
'PluginAssembly' entity doesn't contain attribute with Name = 'packageid' and NameMapping = 'Platform'.
Can you offer a solution ? Thank you.enter image description here
Recently Plugin Registration Tool added new features and if the user used to connect has not a System Administrator role errors can happen.
I don't know if it is related to your case but I will check the roles first.
Also XrmToolBox has a Plugin Registration Tool (you can find it inside the Tool Library) you can try with this version and see if you can connect or not.

document multiple version of API using swaggydoc on grails with same controller name under separate directory

I'm using swaggydoc plugin on my grails application to document the REST APIs. I have two versions of API, v0 and v1 and corresponding controllers with same name, one for each version like:
directory structure
and i have the Url mapping like "/my2api/v1"(controller:"api",namespace:'v1')
"/myapi/v0" (controller:"api", namespace:'v0')
and getting both versions of the API endpoints listed as /myapi/v0/activeContracts like here.
So my question is, how can I get the API end point listed with correct URLs with corresponding versions like /myapi/v0/activeContracts & /myapi/v1/activeContracts as i mentioned I've tried the mapping but it ill just pickup the first the last mapping and assign it to both versions.
Any help would be greatly appreciated.
For people facing the same prob, I couldn't find a solution using swaggyDocs and also came across some post suggesting it doesn't support API versioning so ended up switching to Grails RestApiDoc which provides a lot more control (changing the API conf by just editing the json) than I was able to get on swaggyDocs. But please do post if someone knows a way to work it out in swaggyDoc.

Jira V6.0+ creating a project over REST API

I've got a problem: I'm working on an external webinterface for my company and we use Atlassians JIRA as a project issue and tracking method. I am trying to connect our webinterface over the REST API. After a short research I found out, that Atlassian never implemented the possibility to create a new JIRA Project over their REST API. Well, that isn't that true, they've implemented it in the actual version (7.0) because they migrated their other two APIs to one REST API. Now comes my problem: We are currently unable to upgrade from version 6.4.4 to version 7.0.0. After a second search I found a workaround for this problem. You can find it here:
The real problem is that this workaround isn't working or I'm doing it wrong.
I've already tried it with a GET request and the given arguments as parameters and over the normal POST method with a JSON body in it.
What's my problem?
Here some more informations: When I try it over GET, I always receive the normal response for the URL (it returns a list with all available templates). When I try it over POST with a JSON body (this is by the way the normal method for the normal functions of the REST API) I get back a HTTP-Error 415 Unsupported media type.
it would be nice if someone could test this workaround with a 6.0+ version of JIRA
So after some months I got it by myself. You have to make a POST request with the following header fields:
Content-Type=application/x-www-form-urlencoded; charset=UTF-8
Authorization=Basic {set your credentials as a Base64-String: "user:password"}
X-Atlassian-Token=nocheck
Once done you can set your POST-Parameters to the following:
name=Name of the Project
key=Key of the Project
lead=Leader of the Project
keyEdited=true (don't change it!)
projectTemplateWebItemKey=com.atlassian.jira-legacy-project-templates:jira-blank-item (don't change it!)
projectTemplateModuleKey=com.atlassian.jira-legacy-project-templates:jira-blank-item (don't change it!)
Hope that this helps someone, Jira is just weird in some cases :/

OAuth2 w/ Google Client API 1.8.1

I have been using the Google Client API in a .NET web application - but need to update to the latest version (both to use the most recent code but also to lose the need for the DotNetOpenAuth.dll.) The latest version (1.8.1) has a totally redesigned OAuth interface (using google.apis.auth) and I can't seem to even get started w/ it.
Previously I had written code that handled generating an AuthorizationURL (as needed) and creating IAuthenticator and IAuthorizationState objects - storing the refresh token in a sql database as needed. I was also about to retrieve "UserInfo" about the user as needed (once authenticated.)
Now - I'm unclear on how to handle the generation of the AuthURL (do I have to do it 100% manually?) and how/what I need to pass to the BaseClientService.Initializer when working w/ client API (such as Google Drive.)
Also - previously I wrote methods to "store" and "retrieve" credentials from the database - now it seems I would need to write a class based on IDataStore? But I'm not sure if this is even correct (let alone find a decent sample/doc anywhere.)
Finally - it doesn't seem like google.apis.auth handles anything w/ regards to UserInfo - I have to grab google.apis.oauth2 - but that .dll has even LESS documentation/sample code out there.
Any advice on where to start? The google.apis sample code seems decent for performing basic api tasks but all the Oauth2 information is very basic, uses file data storage and seems glossed over.
Thanks!
First of all, take a look at https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth. All the documentation that you might need is there, and if something is missing let us know!
You are right, you already have an implementation of FileDataStore, and we are planning to create EFDataStore as well for the next release.

Downloading YouTube video information, used to work, now not so much

I used to have some code for downloading youtube data and processing it and everything worked fine until google changed something. Was around the time they changed it from 1 channel per account to as many as you want.
This is a sample of the feed that I would download and process but I can’t seem to get it working.
feedUrl = http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads
The code I would use to process it looks like this;
Dim videoFeed As Feed(Of Video) = request.[Get](Of Video)(New Uri(feedUrl))
In the references section, I used to have v2.1 of the google.GData.YouTube, .Extensions & .Client addons and I have updated them to 2.2.
I tried changing the code that processes the line to this but it still doesn’t work.
Dim videoFeed As Feed(Of Google.YouTube.Video) = request.[Get](Of Google.YouTube.Video)(New Uri(feedUrl))
The code runs over the line ok, it’s when it tries to use videoFeed, it throws the error.
intTotalVideos = videoFeed.TotalResults
The error I get is as follows;
Execution of request failed: http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads
I don’t know what changed on the google side, maybe it was the new v3 API or the way you log in via code changed when they let you have multiple channels per account.
If anyone has any advice or where I can find more information, it would be greatly appreciated.
(I tried to find the original code on the net that I used to create the project but was unable to find it sorry.)
According to Developer's Guide: .NET:
The YouTube Data API (v2) has been officially deprecated as of March
4, 2014. Please refer to our deprecation policy for more information.
The following V2 example works for me:
Dim settings As New YouTubeRequestSettings(applicationName, developerKey)
Dim request As New YouTubeRequest(settings)
Dim videoFeed As Feed(Of Video) = request.[Get](Of Video)(New Uri(feedUrl))
Dim intTotalVideos As Integer = videoFeed.TotalResults
Google YouTube SDK .Net Library with version 2.2.0 is used.