MovieTutorial Genre #7191
Unanswered
Habib-Abdal
asked this question in
Help
Replies: 1 comment
-
https://serenity.is/docs/tutorials/movies/07-adding-movie-genres in the first step, you need to add migration for GenreId field. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the problem which is saying "Invalid GenreId" the code and image of error is here as below:
MovieRow Code:
`using Serenity.ComponentModel;
using Serenity.Data;
using Serenity.Data.Mapping;
using System;
using System.ComponentModel;
namespace MovieTutorial.MovieDb;
[ConnectionKey("Default"), Module("MovieDb"), TableName("[Mov].[Movie]")]
[DisplayName("Movies"), InstanceName("Movie")]
[ReadPermission("Administration:General")]
[ModifyPermission("Administration:General")]
[ServiceLookupPermission("Administration:General")]
public sealed class MovieTableRow : Row<MovieTableRow.RowFields>, IIdRow, INameRow
{
[DisplayName("Movie Id"), Identity, IdProperty]
public int? MovieId { get => fields.MovieId[this]; set => fields.MovieId[this] = value; }
}
Movie Form Code:
using Serenity.ComponentModel;using System;
namespace MovieTutorial.MovieDb.Forms;
[FormScript("MovieDb.MovieTable")]
[BasedOnRow(typeof(MovieTableRow), CheckNames = true)]
public class MovieTableForm
{
}
the Genre Code:
using Serenity.ComponentModel;using Serenity.Data;
using Serenity.Data.Mapping;
using System.ComponentModel;
namespace MovieTutorial.MovieDb;
[ConnectionKey("Default"), Module("MovieDb"), TableName("[Mov].[Genre]")]
[DisplayName("Genre"), InstanceName("Genre")]
[ReadPermission("Administration:General")]
[ModifyPermission("Administration:General")]
[ServiceLookupPermission("Administration:General")]
[LookupScript("MovieDb.Genre")]
public sealed class GenreRow : Row<GenreRow.RowFields>, IIdRow, INameRow
{
[DisplayName("Genre Id"), Identity, IdProperty]
public int? GenreId { get => fields.GenreId[this]; set => fields.GenreId[this] = value; }
}`
the error:
please any one know the problem help me to solve it:
thank you
Beta Was this translation helpful? Give feedback.
All reactions