I am working in Blazor WASM where my Entity Model classes are in the shared folder so the client and the server can pass instances. API controllers are used to interact with the DB Context, and a Repository pattern in the Client interacts with the controllers through a HttpService. I would like to create a custom ValidationAttribute that leverages client side validation of an Indexed(Unique) property of an entity and flags the InputText before a post/put request can be sent. I already have Entity.HasIndex().IsUnique() setup in OnModelCreating, so this logic is forced on the back end, but I would like to have something in the EditForm. The problem is, the Shared project has no access to the Server project (naturally), so it cannot ping the DB to check for violations. Is there a way around this (maybe by creating a validation attritute that can be applied directly to the front end)?
Blazor Custom ValidationAttribute For Unique Constraint
358 Views Asked by Josh Johner At
0
There are 0 best solutions below
Related Questions in BLAZOR-WEBASSEMBLY
- How to share authorization implemented in the server project with the client project in Blazor Web App Auto project?
- Stopwatch loosing time in a browser using blazor and web assembly when browser put in background
- Blazor Component Inside Orchard Core Module
- Blazor WebAssembly with API protected with Windows authentication
- BUnit set value to MudTextField with Mask
- Invalid Operation Exception: Cannot provide a value for property
- Blazor failed to attach to debugger issue
- Binding values in Blazor
- How to bind event in MarkupString
- Lost instance of my grpc in blazor webassembly when reload page
- Deploying Blazor webassembly on Windows local server not working as well
- Error in Using references with Blazor Client
- Does an EditForm can be declared inside a blazor component?
- Blazor gRPC use Windows-Authentication
- Should you implement a custom RemoteAuthenticatorView Blazor WASM
Related Questions in VALIDATIONATTRIBUTE
- ValidationAttribute for Specific Values Only
- FormNoValidate when using a custom ValidationAttribute
- Unable to get Configuration object using validationContext
- How to use a class (instead of a Blazor Component) with an injected service in another class?
- Custom ValidationAttribute on two properties
- Custom validation attributes for blazor, not validating
- Why is "memberNames" parameter in "ValidationResult" is a collection type?
- Web API attribute validation does not return all errors
- Is dbContext (retrieved from ValidationContext.GetService in Blazor Server Side app) thread safe?
- Validation Context is always NULL
- .NET Core - How to solve email aready exist when updating data with the same email
- ValidationAttribute based on the value of another property
- Why should Custom Validation Attributes be sealed in C#
- Custom Validation Attribute for validation on another field in the Model example Shipped Qty Cannot be > Ordered Qty
- Custom Validation Attribute: Comparing one property to another property's inner property
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?