Thursday, September 28, 2017

Get the visual view of the model in Entity Framework Code First


In this post we will discuss how to generate visual view from the models in Entity Framework Code First.

I’m using Visual Studio  2017 as the tool and Entity Framework version 6.

Solution Structure

I have two projects in the solutions.

  1. BlogSample.BO
    In this project we will have all the Business Objects.
  2. BlogSample.DAL
    This is  the data access layer and we have installed Entity Framework 6 and created DbContex and the Dataset. Also the BlogSample.BO project has been referenced as well.

Step 1

Install Entity Framework 6 Power Tools Community Edition

In Visual Studio go to Tools –> Extensions and Updates.

Search for Entity Framework 6 Power Tools and install the extension.

See the image below. I have already installed.

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud

Step 2

Make DAL project as Startup project. Right click on the Context.cs file and go to Entity Framework –> View Entity Data Model.

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud2

Your .edmx visual diagram will be generated as below. 

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud


The solution is available in the below url.

Monday, September 11, 2017

SharePoint Framework (SPFx) Client Side Web Part – Learning Path

Will be updated frequently


In this post, I will share the learning materials (articles, videos, blogpost, microblog post) with related to SharePoint Framework Client Side Web Part.

Going through these materials will make you a great SharePoint Framework Web Part developer.

Angular JS 1.x with SharePoint Framework client side web part

Angular (Angular JS 2 +) with SharePoint Framework client side web part

Saturday, September 9, 2017

WebHooks in SharePoint Online – Post 1 – Introduction

“WebHooks in SharePoint Online” will be a series of blog posts.

  1. WebHooks in SharePoint Online – Post 1 – Introduction

This is the first post of the series and this post will be on introduction to SharePoint Online WebHooks.

Introduction to WebHooks

WebHooks are HTTP services where the subscribers will notified of events happening. Not only Office 365 or SharePoint uses WebHooks, but it’s a universal model used by Facebook, GitHub, MailChimp etc.

Introduction to WebHooks in SharePoint Online / SharePoint Online WebHooks

WebHooks in SharePoint Online are used for Document Libraries or lists. WebHooks in SharePoint Online are asynchronous event supported, which means that the notification is pushed to subscribers when items are added, updated, deleted or moved. WebHooks in SharePoint Online are not synchronous (“-ing”) event supported. Microsoft recommends Remote Event Receivers for synchronous events.

Why WebHooks over Remote Event Receivers

  • WebHooks are easier to consume by “non-SharePoint” developers

Advantages of SharePoint Online WebHooks

  • Easy to subscribe and push notification
  • Automatic retry is available on failure up to 5 minutes
  • Deleted event is available
  • Universal model
  • Can be used in modern SharePoint development stack such as SharePoint Framework

Disadvantages of SharePoint Online WebHooks

  • The subscription period will be expired automatically in 6 months and the subscribers have to re subscribe.
  • You cannot use webhooks to cancel an operation.
  • SharePoint Online lists and libraries are available.
  • No synchronous method is supported.
  • Acknowledgement must be received quickly within 5 seconds.
  • Subscription and notification uses the same url. The developers should implement their own logics to differ the calls.

Keep in mind when you develop solutions using WebHooks

  • WebHooks are only for asynchronous calls
  • Send the acknowledgement within 5 seconds
  • Implement a way to update the subscription if it is about to expire.

Tuesday, September 5, 2017

Access SharePoint group users from SharePoint Hosted Add-in through Rest API


I was using SharePoint rest api in order to read the users from a SharePoint group.


   var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getbyname('" + groupName + "')/users";

We can use the Add-in web url since the groups are inherited from the parent site (Host web) to the add-in web.


When a user (other than the site collection administrator) try to access the above rest url, it throws access denied exception.

Access denied when trying to get users from SharePoint group


Step 1

Go to “People and groups” under Site Setting.

Step 2

Select the group and then go to “Group Setting” under Setting.


Step 3

Then select “Everyone” radio button for the "Who can view the membership of the group?" option.


Step 4

Click OK


Now other users also will have  the permission to read the users in the group.