Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi our
i have this class code
[System.Web.DynamicData.TableName("BlogLikesViews")] [PrimaryKey("BlogNewsId", AutoIncrement = true)] [ExplicitColumns] public class BlogComment { [Column("id")] [PrimaryKeyColumn(AutoIncrement = true)] public int BlogNewsId { get; set; } [Column("BlogNewsUmbracoId")] public int BlogNewsUmbracoId { get; set; } [Column("Views")] public string Views { get; set; } [Column("Likes")] public string Likes { get; set; } }
how can i create the table if not exist when the application start and how can i store the likes and views for each news node ?
Hi Mus'ab,
You seem to have a duplicate question (Although slightly different). I've answered on there but essentially:
https://our.umbraco.com/documentation/Extending/Database/
^^ This is your best guide to getting started with adding tables to the Umbraco v8 database.
Nik
Hi Nik
another question how can i execute a query on the table from the views ?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to use a custom database table to store likes and views ?
Hi our
i have this class code
how can i create the table if not exist when the application start and how can i store the likes and views for each news node ?
Hi Mus'ab,
You seem to have a duplicate question (Although slightly different). I've answered on there but essentially:
https://our.umbraco.com/documentation/Extending/Database/
^^ This is your best guide to getting started with adding tables to the Umbraco v8 database.
Nik
Hi Nik
another question how can i execute a query on the table from the views ?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.